﻿<UserControl x:Class="EX_NFC.FrontEnd.Windows.Controls.DeviceLCDControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
             mc:Ignorable="d"
             d:DesignHeight="490"
             d:DesignWidth="760">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <!-- ROW 0-->
        <ToggleButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_Backlight}"
                      Command="{Binding CommandLCDBacklight}"
                      Margin="{DynamicResource BasicMargin}"
                      Width="{DynamicResource MediumControlWidth}"
                      Height="{DynamicResource MediumControlHeight}" />
        <ComboBox Grid.Column="1"
                  Grid.Row="0"
                  ItemsSource="{Binding ContrastLevels}"
                  SelectedIndex="{Binding SelectedContrastIndex}"
                  Margin="{DynamicResource BasicMargin}"
                  Width="{DynamicResource MediumControlWidth}"
                  Height="{DynamicResource MediumControlHeight}" />
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_SetContrast}"
                Grid.Row="0"
                Grid.Column="2"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandSetLEDs}" />
        <!-- ROW 1-->
        <extToolkit:WatermarkTextBox Grid.Row="1"
                                     Grid.Column="0"
                                     Watermark="{Binding Source={StaticResource Localizer},Path=Localize.LCD_Text}"
                                     Text="{Binding LCDMessage,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                                     VerticalAlignment="Center"
                                     Margin="{DynamicResource BasicMargin}"
                                     MaxLength="{Binding DeviceInfo.NumberOfLCDColumns}" />
        <ComboBox Grid.Column="1"
                  Grid.Row="1"
                  ItemsSource="{Binding LCDRows}"
                  SelectedIndex="{Binding SelectedLCDRow}"
                  Margin="{DynamicResource BasicMargin}"
                  Width="{DynamicResource MediumControlWidth}"
                  Height="{DynamicResource MediumControlHeight}" />
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_SetText}"
                Grid.Row="1"
                Grid.Column="2"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandLCDMessage}" />
        <!-- ROW 2 -->
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_Image}"
                Grid.Row="2"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Click="Button_Click" />
        <!-- ROW 3 -->
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_Clear}"
                Grid.Row="3"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandLCDClear}" />
        <!-- ROW 4 -->
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollDirection}"
                   Grid.Column="0"
                   Grid.Row="4"
                   Style="{DynamicResource ContentTextStyle}"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Center" />
        <StackPanel Grid.Column="1"
                    Grid.ColumnSpan="2"
                    Grid.Row="4"
                    Orientation="Horizontal">
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollDirection_LeftToRight}"
                         IsChecked="{Binding LCDScrollL2R}"
                         Margin="{DynamicResource BasicMargin}" />
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollDirection_RightToLeft}"
                         IsChecked="{Binding LCDScrollR2L}"
                         Margin="{DynamicResource BasicMargin}" />
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollDirection_UpToDown}"
                         IsChecked="{Binding LCDScrollT2B}"
                         Margin="{DynamicResource BasicMargin}" />
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollDirection_DownToUp}"
                         IsChecked="{Binding LCDScrollB2T}"
                         Margin="{DynamicResource BasicMargin}" />
        </StackPanel>
        <!-- ROW 5 -->
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollSpeed}"
                   Grid.Column="0"
                   Grid.Row="5"
                   Style="{DynamicResource ContentTextStyle}"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Center" />
        <StackPanel Grid.Column="1"
                    Grid.ColumnSpan="2"
                    Grid.Row="5"
                    Orientation="Horizontal">
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollSpeed_Slow}"
                         IsChecked="{Binding LCDScrollSpeedSlow}"
                         Margin="{DynamicResource BasicMargin}" />
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollSpeed_Medium}"
                         IsChecked="{Binding LCDScrollSpeedMedium}"
                         Margin="{DynamicResource BasicMargin}" />
            <RadioButton Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_ScrollSpeed_Fast}"
                         IsChecked="{Binding LCDScrollSpeedFast}"
                         Margin="{DynamicResource BasicMargin}" />
        </StackPanel>
        <!-- ROW 6 -->
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_StartScroll}"
                Grid.Row="6"
                Grid.Column="0"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandLCDScroll}" />
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_PauseScroll}"
                Grid.Row="6"
                Grid.Column="1"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandLCDPauseScroll}" />
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.LCD_StopScroll}"
                Grid.Row="6"
                Grid.Column="2"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}"
                Command="{Binding CommandLCDStopScroll}" />
    </Grid>
</UserControl>
